import * as types from './mutation-types'
import {
  setUserInfoStorage,
  setUserTokenStorage,
  setSellerInfoStorage,
  setAutoTableStorage,
  setTablesStorage,
  setHandTableStorage,
  setPackagesStorage,
  setAddedPackageStorage,
  setLogisticListStorage,
  setCommonPackageStorage,
  setLogoInfoStorage
} from './storeFuns'

// 用户详情
export const setUserInfo = ({
  commit
}, query) => {
  commit(types.SET_USERINFO, setUserInfoStorage(query))
}

// 商家详情
export const setSellerInfo = ({
  commit
}, query) => {
  commit(types.SET_SELLERINFO, setSellerInfoStorage(query))
}

// 用户 Token
export const setUserToken = ({
  commit
}, query) => {
  commit(types.SET_USERTOKEN, setUserTokenStorage(query))
}

// 智能发包上传文件返回值
export const setAutoTable = ({
  commit
}, query) => {
  commit(types.SET_AUTOTABLE, setAutoTableStorage(query))
}

// 表格发包上传文件返回值
export const setTables = ({
  commit
}, query) => {
  commit(types.SET_TABLES, setTablesStorage(query))
}

// 手工下单返回值
export const setHandTable = ({
  commit
}, query) => {
  commit(types.SET_HANDTABLE, setHandTableStorage(query))
}

// 本地存储添加的礼品包
export const setPackages = ({
  commit
}, query) => {
  commit(types.SET_PACKAGES, setPackagesStorage(query))
}

// 本地存储是否添加过礼品包且提示他
export const setAddedPackage = ({
  commit
}, query) => {
  commit(types.SET_ADDEDPACKAGE, setAddedPackageStorage(query))
}

// 设置物流价格列表
export const setLogisticList = ({
  commit
}, query) => {
  commit(types.SET_LOGISTICLIST, setLogisticListStorage(query))
}

// 设置常用礼品包列表
export const setCommonPackage = ({
  commit
}, query) => {
  commit(types.SET_COMMONPACKAGE, setCommonPackageStorage(query))
}

// 设置logo信息
export const setLogoInfo = ({
  commit
}, query) => {
  commit(types.SET_LOGOINFO, setLogoInfoStorage(query))
}
